<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'folder.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<LINK href="<%=basePath%>css/folder.css" type="text/css"
	rel="stylesheet">
<script type="text/javascript">
function check(){
	if(document.getElementById("allcheck").checked){
		var list = document.getElementsByName("checkb");
		for(var i=0;i<list.length;i++){
			list[i].checked="checked";
		}

	}else{
		
		var list = document.getElementsByName("checkb");
		for(var i=0;i<list.length;i++){
			list[i].checked="";
		}
	}
}


function deleteAll(){
	if(window.confirm("确定删除所选？")){
		var list = document.getElementsByName("checkb");
		var arr = new Array();
		
		for(var i=0,j=0;i<list.length;i++){
			if(list[i].checked){
				arr[j]=list[i].value;
				
				j++;
			}
		}
		window.location="FileCenterServlet?action=deleteAll&auidList="+arr+"&pid="+arr[0];
		alert("删除成功！");
	}	
}
</script>
</head>

<BODY class="bodycolor" topMargin=0>

<table border="0" width="100%" cellspacing="0" cellpadding="3"
	class="small">
	<tr>
		<td class="Big"><img src="<%=basePath%>img/file/notify_open.gif"
			align="absmiddle"><b><span class="Big1"> ${fName } </span></b><br>
		</td>
	</tr>
</table>

<BR>

<c:choose>
	<c:when test="${sign eq 'no' }">
		<table class="MessageBox" align="center" width="300">
			<tr>
				<td class="msg info">
				<div class="content" style="font-size: 12pt">该文件夹尚无文件</div>
				</td>
			</tr>
		</table>
	</c:when>
	<c:otherwise>

		<table class="TableList" width="100%">
			<tr class="TableHeader" align="center">
				<td width="40">选择</td>
				<td onClick="order_by('SUBJECT','1');" style="cursor: hand;"><u>作业名称</u></td>

				<td onClick="order_by('SEND_TIME','1');" style="cursor: hand;"><u>发布时间</u></td>

				<td nowrap>操作</td>
			</tr>
			<c:forEach items="${HomeWorkList}" var="list">
				<tr class="TableLine1">
					<td>&nbsp;<input type="checkbox" name="checkb"
						value="${list.exID }"></td>
					<td><a
						href="FileCenterServlet?action=displayFile&fileID=${list.exID }">${list.exName
					}</a></td>

					<td align="center">${list.uploadTime }</td>

					<td align="center" nowrap><a
						href="FileCenterServlet?action=editFile&fileID=${list.exID }"><img
						src="<%=basePath%>img/file/folder_edit.gif" align="absMiddle"
						border="0" title="编辑所选文件">编辑</a> <a
						href="FileCenterServlet?action=delFile&fileID=${list.exID }"><img
						src="<%=basePath%>img/file/delete.gif" align="absMiddle"
						border="0" title="删除所选文件">删除</a>&nbsp;&nbsp;</td>
				</tr>

			</c:forEach>
			<tr class="TableControl">
				<td colspan="3">&nbsp;<input type="checkbox" name="allbox"
					id="allcheck" onClick="check();"><label for="allbox_for"
					style="cursor: hand">全选</label>&nbsp;</td>
				<td align="center"><input type="button" value="删除所选"
					class="SmallButton" onclick="deleteAll()"></td>
			</tr>
		</table>


	</c:otherwise>
</c:choose>

<BR>
<div id="fsUploadArea" class="flash">
<div id="fsUploadProgress"></div>
<div id="totalStatics" class="totalStatics"></div>

</div>
<table class="TableBlock" width="100%" align="center">

	<tr>
		<td class="TableContent" nowrap align="center" width="80"><b>文件夹操作：</b></td>
		<td class="TableControl"><a
			href="homeWorkServlet?action=toNewEXDIR&type=2&courseID=${courseID }"
			title="创建文件夹"> <img src="<%=basePath%>img/file/newfolder.gif"
			align="absMiddle" border="0">&nbsp;新建文件夹</a>&nbsp;&nbsp;</td>
	</tr>
</table>

</body>
</html>
